/*
floppysize:

opens a file and pads to the size of a floppy (1.4)
early development utility, will be replaced by Unix commands

*/

#include <stdio.h>

int main(int argc, char *argv[])
{
	FILE 	*f;
	long	size, i;
	unsigned char data;

	if(argc <= 1)
	{
		printf("No argument specified.\n");
		return 0;
	}
		
	f = fopen(argv[1], "a+");
	
	if(!f)
	{
		printf("Open file fail.\n");
		return 0;
	}
	
	fseek(f, 0, SEEK_END);
	size = ftell(f);
	
	data = 0x00;
	for(i = size; i < 1474560; i++)
		fwrite(&data, 1, 1, f);
	
	fflush(f);
	fclose(f);
	
	printf("Done.\n");
	return 0;
}
